package com.sourny.ribbon.consumer.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author sourny.yang
 * @date 2018/3/31 11:16
 */
@RestController
public class HelloController {
    @Autowired
    RestTemplate restTemplate;

    @RequestMapping("hello")
    public String hello(){
            return restTemplate.getForEntity("http://SERVICE-A/hello", String.class).getBody();
    }
}
